//package com.guang.springmybatistransaction.service.impl;
//
//import com.guang.springmybatistransaction.dao.UserMapper;
//import com.guang.springmybatistransaction.pojo.user.User;
//import com.guang.springmybatistransaction.service.UserService;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Service;
//import org.springframework.transaction.annotation.EnableTransactionManagement;
//import org.springframework.transaction.annotation.Transactional;
//
//import java.util.List;
//import java.util.concurrent.TimeUnit;
//
///**
// * @author lg
// * @Description
// * @date 2022/9/8 14:19
// */
//@Service
//public class UserServiceImpl implements UserService {
//
//    @Autowired
//    private UserMapper userMapper;
//
//
//    @Override
//    @Transactional
//    public void doHandlTransaction() {
//        try {
//            TimeUnit.SECONDS.sleep(5);
//        } catch (InterruptedException e) {
//            e.printStackTrace();
//        }
//        List<User> users = userMapper.selectAllUser();
//        User user = users.get(0);
//        user.setEmail("tmdemail111");
//        userMapper.updateByPrimaryKeySelective(user);
//        user.setCreatedBy(666111);
//        userMapper.updateByPrimaryKeySelective(user);
//    }
//
//}
